// 评论相关的接口
import request from '@/utils/request.js'
// 获取评论列表
export const getComment = params => {
  return request({
    url: '/v1_0/comments',
    method: 'GET',
    params,
  })
}
// 对评论或评论回复点赞
export const addCommentLike = target => {
  return request({
    method: 'POST',
    url: '/v1_0/comment/likings',
    data: {
      target,
    },
  })
}
// 取消对评论点赞或评论回复点赞
export const delCommentLike = target => {
  return request({
    method: 'DELETE',
    url: `/v1_0/comment/likings/${target}`,
  })
}
// 发布评论
export const addComment = data => {
  return request({
    url: '/v1_0/comments',
    method: 'POST',
    data,
  })
}
